<?php 
	$calendarLanguageTMP = explode('_',Yii::app()->getLanguage());
	$calendarLanguage = $calendarLanguageTMP[0] . '-' . strtoupper($calendarLanguageTMP[1]);
	
	if($calendarLanguageTMP[0] == 'en')
	{
		$calendarLanguage = 'en-GB';
	}
	
	if($calendarLanguageTMP[0] == 'es')
	{
		$calendarLanguage = 'es';
	}

	$ingresoCursoScriptPath = Yii::app()->baseUrl.'/script/modules/carrera';
	$cs = Yii::app()->getClientScript();  
	$cs->registerScriptFile($ingresoCursoScriptPath.'/ingresoCurso.js',CClientScript::POS_END);
	$cs->registerScript('cargar-ingresocurso-variable','var ingresoCurso = new IngresoCurso();',CClientScript::POS_END);
	
	
	$periodoObject				= CHtml::activeId($model, 'ingreso_periodoingreso_id');
	$programaAcademicoObject 	= CHtml::activeId($model, 'ingreso_programaacademico_id');
	
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'ingreso-curso-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo t('Campos con','nucleo_etiqueta');?><span class="required">*</span> <?php echo t('son requeridos','nucleo_etiqueta');?>.</p>

	<?php echo $form->errorSummary($model); ?>
	<fieldset>
		<fieldset>
			<legend><?php echo t('Datos Generales')?></legend>
			<div class="width_half">
			<?php 
				echo $form->labelEx($model,'ingreso_periodoingreso_id');
				echo IngresoCursoServiceUI::getSelectPeriodo($form, 
																$model, 
																'ingreso_periodoingreso_id', 
																$periodoObject, 
																$programaAcademicoObject);
				echo $form->error($model,'ingreso_periodoingreso_id'); 
			?>
			</div>
			<div class="width_half">
			<?php 
				echo $form->labelEx($model,'ingreso_programaacademico_id');
				echo IngresoCursoServiceUI::getSelectProgramaAcademico( $form,
															$model, 
															'ingreso_programaacademico_id', 
															$periodoObject, 
															$programaAcademicoObject);
				echo $form->error($model,'ingreso_programaacademico_id'); 
			?>
			</div>
		</fieldset>
		<fieldset>
			<legend><?php echo t('Cursos','carrera_etiqueta')?></legend>
			<?php
				$this->renderPartial(
										'/ingresoCurso/_ingresocurso_curso',
										array(
												'form'=>$form,
												'cursos'=>$model->cursos,
											)
									);
			?>
		</fieldset>
	</fieldset>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->